<template>
	<view>
		<div class="title" @click="comeBack()">
			<image src="../../static/icon_arrow_blue_left.png"></image>
			检查报告
		</div>

		<view class="Reportdetai" v-for="(item,index) in list" :key="index">
			<view class="Reportdetai-a">
				<view class="Reportdetai-left">
					检查科室
				</view>
				<view class="Reportdetai-right">
					{{item.KDKSMC}}
				</view>
			</view>

			<view class="Reportdetai-a">
				<view class="Reportdetai-left">
					检查医生
				</view>
				<view class="Reportdetai-right">
					{{item.KDKSYS}}
				</view>
			</view>

			<view class="Reportdetai-a">
				<view class="Reportdetai-left">
					就诊人
				</view>
				<view class="Reportdetai-right">
					{{item.JZRXM}}
				</view>
			</view>

			<view class="Reportdetai-a  Reportdetai-s">
				<view class="Reportdetai-left">
					就诊时间
				</view>
				<view class="Reportdetai-right">
					<u--text :text="item.KDSJ" size="28rpx" color="#666"></u--text>
				</view>
			</view>

			<view class="Reportdetai-a ">
				<view class="Reportdetai-left">
					诊断意见
				</view>
				<view class="Reportdetai-right">
					{{!item.ZDYJ?'暂无诊断意见' : item.ZDYJ}}
				</view>
			</view>
			<view class="Reportdetai-a ">
				<view class="Reportdetai-left">
					检查所见
				</view>
				<view class="Reportdetai-right">
					{{!item.JCSJ?'暂无检查所见' : item.JCSJ}}
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts">
	import { globalVariable } from "../../globalVariable/globalVariable";
	import { request } from "../../Providing/request";
	import { uiCollection } from "../../Providing/uiCollection";
	export default {
		data() {
			return {
				list: []

			};
		},
		methods: {
			comeBack() {
				uni.$emit('goToCaseSearch')
			},
			getRecordXmlDetail() {
				new request().getRecordXmlDetail(globalVariable.inspectionReportId).then((res) => {
					console.log("返回报告内容",res)
					if (res['LIST'] && JSON.stringify(res['LIST'] )!== "{}") {
						
						const red = Object.prototype.toString.call(res['LIST'].ITEM) === '[object Object]'
						if (red == true) {
							this.list = []
							this.list.push(res['LIST'].ITEM)
						} else {
							this.list = res['LIST'].ITEM
						}
					}else{
						uiCollection.showToast("获取报告详情失败");
						uni.$emit("goToHome");
					}
				}).catch((err) => {
					uiCollection.showToast("获取报告详情失败");
					uni.$emit("goToHome");
					
				})
			}
		},
		created() {
			this.getRecordXmlDetail();
		}
	}
</script>

<style lang="scss">


.Reportdetai {
		width: 686rpx;
		border-radius: 24rpx;
		border: 2rpx solid #D9D9D9;
		margin-left: 32rpx;
		margin-top: 24rpx;
		padding-bottom: 24rpx;

		.Reportdetai-a {
			// width: 686rpx;
			// height: 38rpx;
			margin-top: 24rpx;
			display: flex;
			margin-left: 24rpx;

			.Reportdetai-left {
				width: 152rpx;
				height: 38rpx;
				font-size: 28rpx;
				color: #AAAAAA;
			}

			.Reportdetai-right {
				width: 100%;
				font-size: 28rpx;
				color: #666666;

			}
		}


	}
</style>